package com.yuexunit.mobilenurse.module.NursingDocuments.ui;

import android.content.Context;
import android.view.MotionEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;

import com.yuexunit.mobilenurse.R;
import com.yuexunit.mobilenurse.config.AppConfig;
import com.yuexunit.mobilenurse.module.NursingDocuments.model.impl.DocumentRecordDetailModel;
import com.yuexunit.mobilenurse.module.NursingDocuments.presenter.impl.DocumentRecordDetailPresenter;
import com.yuexunit.mobilenurse.module.NursingDocuments.ui.view.IDocumentRecordDetailView;

import org.kymjs.kjframe.KJActivity;
import org.kymjs.kjframe.utils.PreferenceHelper;
import org.kymjs.kjframe.utils.StringUtils;

import java.util.HashMap;
import java.util.Map;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by work-jx on 2016/12/28.
 */
public class Act_DocumentBloodSugarDetail extends KJActivity implements IDocumentRecordDetailView {
    @Bind(R.id.signinput_name)
    TextView signinputName;
    @Bind(R.id.signinput_bedno)
    TextView signinputBedno;
    @Bind(R.id.signinput_visitno)
    TextView signinputVisitno;

    @Bind(R.id.bs_em_edt)
    EditText bsEmEdt;
    @Bind(R.id.bs_bb_edt)
    EditText bsBbEdt;
    @Bind(R.id.bs_ab_edt)
    EditText bsAbEdt;
    @Bind(R.id.bs_bis_edit)
    EditText bsBisEdt;
    @Bind(R.id.bs_bi1_edit)
    EditText bsBi1Edt;
    @Bind(R.id.bs_biu1_edt)
    EditText bsBiu1Edt;
    @Bind(R.id.bs_bi2_edit)
    EditText bsBi2Edt;
    @Bind(R.id.bs_biu2_edt)
    EditText bsBiu2Edt;

    @Bind(R.id.bs_bl_edt)
    EditText bsBlEdt;
    @Bind(R.id.bs_al_edt)
    EditText bsAlEdt;
    @Bind(R.id.bs_lis_edit)
    EditText bsLisEdt;
    @Bind(R.id.bs_li1_edit)
    EditText bsLi1Edt;
    @Bind(R.id.bs_liu1_edt)
    EditText bsLiu1Edt;
    @Bind(R.id.bs_li2_edit)
    EditText bsLi2Edt;
    @Bind(R.id.bs_liu2_edt)
    EditText bsLiu2Edt;

    @Bind(R.id.bs_bd_edt)
    EditText bsBdEdt;
    @Bind(R.id.bs_ad_edt)
    EditText bsAdEdt;
    @Bind(R.id.bs_dis_edit)
    EditText bsDisEdt;
    @Bind(R.id.bs_di1_edit)
    EditText bsDi1Edt;
    @Bind(R.id.bs_diu1_edt)
    EditText bsDiu1Edt;
    @Bind(R.id.bs_di2_edit)
    EditText bsDi2Edt;
    @Bind(R.id.bs_diu2_edt)
    EditText bsDiu2Edt;

    @Bind(R.id.bs_bs_edt)
    EditText bsBsEdt;
    @Bind(R.id.bs_sis_edit)
    EditText bsSisEdt;
    @Bind(R.id.bs_si1_edit)
    EditText bsSi1Edt;
    @Bind(R.id.bs_siu1_edt)
    EditText bsSiu1Edt;
    @Bind(R.id.bs_si2_edit)
    EditText bsSi2Edt;
    @Bind(R.id.bs_siu2_edt)
    EditText bsSiu2Edt;

//    @Bind(R.id.bs_bone_date_01)
//    TextView bsBoneDate01;
//    @Bind(R.id.bs_bone_hour_01)
//    Spinner bsBoneHour01;
//    @Bind(R.id.bs_edt_01)
//    EditText bsEdt01;
//    @Bind(R.id.bs_bone_date_02)
//    TextView bsBoneDate02;
//    @Bind(R.id.bs_bone_hour_02)
//    Spinner bsBoneHour02;
//    @Bind(R.id.bs_edt_02)
//    EditText bsEdt02;
//    @Bind(R.id.bs_bone_date_03)
//    TextView bsBoneDate03;
//    @Bind(R.id.bs_bone_hour_03)
//    Spinner bsBoneHour03;
//    @Bind(R.id.bs_edt_03)
//    EditText bsEdt03;
//    @Bind(R.id.bs_bone_date_04)
//    TextView bsBoneDate04;
//    @Bind(R.id.bs_bone_hour_04)
//    Spinner bsBoneHour04;
//    @Bind(R.id.bs_edt_04)
//    EditText bsEdt04;
//    @Bind(R.id.bs_bone_date_05)
//    TextView bsBoneDate05;
//    @Bind(R.id.bs_bone_hour_05)
//    Spinner bsBoneHour05;
//    @Bind(R.id.bs_edt_05)
//    EditText bsEdt05;
//    @Bind(R.id.bs_bone_date_06)
//    TextView bsBoneDate06;
//    @Bind(R.id.bs_bone_hour_06)
//    Spinner bsBoneHour06;
//    @Bind(R.id.bs_edt_06)
//    EditText bsEdt06;
//    @Bind(R.id.bs_bone_date_07)
//    TextView bsBoneDate07;
//    @Bind(R.id.bs_bone_hour_07)
//    Spinner bsBoneHour07;
//    @Bind(R.id.bs_edt_07)
//    EditText bsEdt07;
//    @Bind(R.id.bs_bone_date_08)
//    TextView bsBoneDate08;
//    @Bind(R.id.bs_bone_hour_08)
//    Spinner bsBoneHour08;
//    @Bind(R.id.bs_edt_08)
//    EditText bsEdt08;
//    @Bind(R.id.bs_bone_date_09)
//    TextView bsBoneDate09;
//    @Bind(R.id.bs_bone_hour_09)
//    Spinner bsBoneHour09;
//    @Bind(R.id.bs_edt_09)
//    EditText bsEdt09;
//    @Bind(R.id.bs_bone_date_10)
//    TextView bsBoneDate10;
//    @Bind(R.id.bs_bone_hour_10)
//    Spinner bsBoneHour10;
//    @Bind(R.id.bs_edt_10)
//    EditText bsEdt10;
//    @Bind(R.id.bs_bone_date_11)
//    TextView bsBoneDate11;
//    @Bind(R.id.bs_bone_hour_11)
//    Spinner bsBoneHour11;
//    @Bind(R.id.bs_edt_11)
//    EditText bsEdt11;
//    @Bind(R.id.bs_bone_date_12)
//    TextView bsBoneDate12;
//    @Bind(R.id.bs_bone_hour_12)
//    Spinner bsBoneHour12;
//    @Bind(R.id.bs_edt_12)
//    EditText bsEdt12;
//    @Bind(R.id.bs_bone_date_13)
//    TextView bsBoneDate13;
//    @Bind(R.id.bs_bone_hour_13)
//    Spinner bsBoneHour13;
//    @Bind(R.id.bs_edt_13)
//    EditText bsEdt13;
//    @Bind(R.id.bs_bone_date_14)
//    TextView bsBoneDate14;
//    @Bind(R.id.bs_bone_hour_14)
//    Spinner bsBoneHour14;
//    @Bind(R.id.bs_edt_14)
//    EditText bsEdt14;
//    @Bind(R.id.bs_bone_date_15)
//    TextView bsBoneDate15;
//    @Bind(R.id.bs_bone_hour_15)
//    Spinner bsBoneHour15;
//    @Bind(R.id.bs_edt_15)
//    EditText bsEdt15;
//    @Bind(R.id.bs_bone_date_16)
//    TextView bsBoneDate16;
//    @Bind(R.id.bs_bone_hour_16)
//    Spinner bsBoneHour16;
//    @Bind(R.id.bs_edt_16)
//    EditText bsEdt16;
//    @Bind(R.id.bs_bone_date_17)
//    TextView bsBoneDate17;
//    @Bind(R.id.bs_bone_hour_17)
//    Spinner bsBoneHour17;
//    @Bind(R.id.bs_edt_17)
//    EditText bsEdt17;
//    @Bind(R.id.bs_bone_date_18)
//    TextView bsBoneDate18;
//    @Bind(R.id.bs_bone_hour_18)
//    Spinner bsBoneHour18;
//    @Bind(R.id.bs_edt_18)
//    EditText bsEdt18;
//    @Bind(R.id.bs_bone_date_19)
//    TextView bsBoneDate19;
//    @Bind(R.id.bs_bone_hour_19)
//    Spinner bsBoneHour19;
//    @Bind(R.id.bs_edt_19)
//    EditText bsEdt19;
//    @Bind(R.id.bs_bone_date_20)
//    TextView bsBoneDate20;
//    @Bind(R.id.bs_bone_hour_20)
//    Spinner bsBoneHour20;
//    @Bind(R.id.bs_edt_20)
//    EditText bsEdt20;
//    @Bind(R.id.bs_bone_date_21)
//    TextView bsBoneDate21;
//    @Bind(R.id.bs_bone_hour_21)
//    Spinner bsBoneHour21;
//    @Bind(R.id.bs_edt_21)
//    EditText bsEdt21;
//    @Bind(R.id.bs_bone_date_22)
//    TextView bsBoneDate22;
//    @Bind(R.id.bs_bone_hour_22)
//    Spinner bsBoneHour22;
//    @Bind(R.id.bs_edt_22)
//    EditText bsEdt22;
//    @Bind(R.id.bs_bone_date_23)
//    TextView bsBoneDate23;
//    @Bind(R.id.bs_bone_hour_23)
//    Spinner bsBoneHour23;
//    @Bind(R.id.bs_edt_23)
//    EditText bsEdt23;
//    @Bind(R.id.bs_bone_date_24)
//    TextView bsBoneDate24;
//    @Bind(R.id.bs_bone_hour_24)
//    Spinner bsBoneHour24;
//    @Bind(R.id.bs_edt_24)
//    EditText bsEdt24;

    public String inpNo;//住院号
    public String recorder;//记录人员id

    private DocumentRecordDetailPresenter presenter;

    @Override
    public void setRootView() {
        setContentView(R.layout.act_documentbloodsugardetail);
        ButterKnife.bind(this);
    }

    @Override
    public void initData() {
        super.initData();
        presenter = new DocumentRecordDetailPresenter(new DocumentRecordDetailModel(), this);
        inpNo = PreferenceHelper.readString(aty, AppConfig.CURRENT_PATIENT_INFO, AppConfig.CURRENT_PATIENT_VISITNO);
        recorder = PreferenceHelper.readString(aty, AppConfig.NURSE_INFO, AppConfig.NURSE_LOGID);
    }

    @Override
    public void initWidget() {
        super.initWidget();
        signinputName.setText(PreferenceHelper.readString(aty, AppConfig.CURRENT_PATIENT_INFO, AppConfig.CURRENT_PATIENT_NAME));
        signinputBedno.setText(PreferenceHelper.readString(aty, AppConfig.CURRENT_PATIENT_INFO, AppConfig.CURRENT_PATIENT_BEDCODE));
        signinputVisitno.setText(inpNo);
    }

    /**
     * 通过dispatchTouchEvent每次ACTION_DOWN事件中动态判断非EditText本身区域的点击事件，然后在事件中进行屏蔽。然后当点击不是EditText时候，进行隐藏键盘操作
     *
     * @param ev
     * @return
     */
    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
            View v = getCurrentFocus();
            if (isShouldHideInput(v, ev)) {

                InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
                if (imm != null) {
                    imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
                }
            }
            return super.dispatchTouchEvent(ev);
        }
        if (getWindow().superDispatchTouchEvent(ev)) {
            return true;
        }
        return onTouchEvent(ev);
    }

    public boolean isShouldHideInput(View v, MotionEvent event) {

        if (v != null && (v instanceof EditText)) {
            int[] leftTop = {0, 0};
            //获取输入框当前的location位置
            v.getLocationInWindow(leftTop);
            int left = leftTop[0];
            int top = leftTop[1];
            int bottom = top + v.getHeight();
            int right = left + v.getWidth();
            if (event.getX() > left && event.getX() < right
                    && event.getY() > top && event.getY() < bottom) {
                // 点击的是输入框区域，保留点击EditText的事件\
                return false;
            } else {
                return true;
            }
        }
        return false;
    }

    @Override
    public void uploadRecord() {
        finish();
    }

    @OnClick({R.id.titlebar_img_back, R.id.right_text, R.id.titlebar_img_menu})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.titlebar_img_back:
                finish();
                break;
            case R.id.right_text:
                buildValue();
                break;
            case R.id.titlebar_img_menu:
                buildValue();
                break;
        }
    }

    private void buildValue() {
        StringBuilder builder = new StringBuilder();
        if (!StringUtils.isEmpty(bsEmEdt.getText().toString())) {
            builder.append("637" + ":" + bsEmEdt.getText().toString());
        }

        if (!StringUtils.isEmpty(bsBbEdt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",638:" + bsBbEdt.getText().toString());
            } else {
                builder.append("638:" + bsBbEdt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsAbEdt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",688:" + bsAbEdt.getText().toString());
            } else {
                builder.append("688:" + bsAbEdt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsBisEdt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",689:" + bsBisEdt.getText().toString());
            } else {
                builder.append("689:" + bsBisEdt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsBi1Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",693:" + bsBi1Edt.getText().toString());
            } else {
                builder.append("693:" + bsBi1Edt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsBiu1Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",701:" + bsBiu1Edt.getText().toString());
            } else {
                builder.append("701:" + bsBiu1Edt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsBi2Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",694:" + bsBi2Edt.getText().toString());
            } else {
                builder.append("694:" + bsBi2Edt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsBiu2Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",702:" + bsBiu2Edt.getText().toString());
            } else {
                builder.append("702:" + bsBiu2Edt.getText().toString());
            }
        }



        if (!StringUtils.isEmpty(bsBlEdt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",639:" + bsBlEdt.getText().toString());
            } else {
                builder.append("639:" + bsBlEdt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsAlEdt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",640:" + bsAlEdt.getText().toString());
            } else {
                builder.append("640:" + bsAlEdt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsLisEdt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",690:" + bsLisEdt.getText().toString());
            } else {
                builder.append("690:" + bsLisEdt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsLi1Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",695:" + bsLi1Edt.getText().toString());
            } else {
                builder.append("695:" + bsLi1Edt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsLiu1Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",703:" + bsLiu1Edt.getText().toString());
            } else {
                builder.append("703:" + bsLiu1Edt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsLi2Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",696:" + bsLi2Edt.getText().toString());
            } else {
                builder.append("696:" + bsLi2Edt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsLiu2Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",704:" + bsLiu2Edt.getText().toString());
            } else {
                builder.append("704:" + bsLiu2Edt.getText().toString());
            }
        }



        if (!StringUtils.isEmpty(bsBdEdt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",641:" + bsBdEdt.getText().toString());
            } else {
                builder.append("641:" + bsBdEdt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsAdEdt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",642:" + bsAdEdt.getText().toString());
            } else {
                builder.append("642:" + bsAdEdt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsDisEdt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",691:" + bsDisEdt.getText().toString());
            } else {
                builder.append("691:" + bsDisEdt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsDi1Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",697:" + bsDi1Edt.getText().toString());
            } else {
                builder.append("697:" + bsDi1Edt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsDiu1Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",705:" + bsDiu1Edt.getText().toString());
            } else {
                builder.append("705:" + bsDiu1Edt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsDi2Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",698:" + bsDi2Edt.getText().toString());
            } else {
                builder.append("698:" + bsDi2Edt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsDiu2Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",706:" + bsDiu2Edt.getText().toString());
            } else {
                builder.append("706:" + bsDiu2Edt.getText().toString());
            }
        }



        if (!StringUtils.isEmpty(bsBsEdt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",643:" + bsBsEdt.getText().toString());
            } else {
                builder.append("643:" + bsBsEdt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsSisEdt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",692:" + bsSisEdt.getText().toString());
            } else {
                builder.append("692:" + bsSisEdt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsSi1Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",699:" + bsSi1Edt.getText().toString());
            } else {
                builder.append("699:" + bsSi1Edt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsSiu1Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",707:" + bsSiu1Edt.getText().toString());
            } else {
                builder.append("707:" + bsSiu1Edt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsSi2Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",700:" + bsSi2Edt.getText().toString());
            } else {
                builder.append("700:" + bsSi2Edt.getText().toString());
            }
        }

        if (!StringUtils.isEmpty(bsSiu2Edt.getText().toString())) {
            if (builder.length() != 0) {
                builder.append(",708:" + bsSiu2Edt.getText().toString());
            } else {
                builder.append("708:" + bsSiu2Edt.getText().toString());
            }
        }

//        if (!StringUtils.isEmpty(bsEdt01.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",587:" + bsBoneHour01.getSelectedItem().toString()+"：00"+",591:"+bsEdt01.getText().toString());
//            } else {
//                builder.append("587:" + bsBoneHour01.getSelectedItem().toString()+"：00"+",591:"+bsEdt01.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt02.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",588:" + bsBoneHour02.getSelectedItem().toString()+"：00"+",592:"+bsEdt02.getText().toString());
//            } else {
//                builder.append("588:" + bsBoneHour02.getSelectedItem().toString()+"：00"+",592:"+bsEdt02.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt03.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",589:" + bsBoneHour03.getSelectedItem().toString()+"：00"+",593:"+bsEdt03.getText().toString());
//            } else {
//                builder.append("589:" + bsBoneHour03.getSelectedItem().toString()+"：00"+",593:"+bsEdt03.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt04.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",590:" + bsBoneHour04.getSelectedItem().toString()+"：00"+",594:"+bsEdt04.getText().toString());
//            } else {
//                builder.append("590:" + bsBoneHour04.getSelectedItem().toString()+"：00"+",594:"+bsEdt04.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt05.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",620:" + bsBoneHour05.getSelectedItem().toString()+"：00"+",600:"+bsEdt05.getText().toString());
//            } else {
//                builder.append("620:" + bsBoneHour05.getSelectedItem().toString()+"：00"+",600:"+bsEdt05.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt06.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",621:" + bsBoneHour06.getSelectedItem().toString()+"：00"+",601:"+bsEdt06.getText().toString());
//            } else {
//                builder.append("621:" + bsBoneHour06.getSelectedItem().toString()+"：00"+",601:"+bsEdt06.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt07.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",622:" + bsBoneHour07.getSelectedItem().toString()+"：00"+",602:"+bsEdt07.getText().toString());
//            } else {
//                builder.append("622:" + bsBoneHour07.getSelectedItem().toString()+"：00"+",602:"+bsEdt07.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt08.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",623:" + bsBoneHour08.getSelectedItem().toString()+"：00"+",603:"+bsEdt08.getText().toString());
//            } else {
//                builder.append("623:" + bsBoneHour08.getSelectedItem().toString()+"：00"+",603:"+bsEdt08.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt09.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",624:" + bsBoneHour09.getSelectedItem().toString()+"：00"+",604:"+bsEdt09.getText().toString());
//            } else {
//                builder.append("624:" + bsBoneHour09.getSelectedItem().toString()+"：00"+",604:"+bsEdt09.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt10.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",625:" + bsBoneHour10.getSelectedItem().toString()+"：00"+",605:"+bsEdt10.getText().toString());
//            } else {
//                builder.append("625:" + bsBoneHour10.getSelectedItem().toString()+"：00"+",605:"+bsEdt10.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt11.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",626:" + bsBoneHour11.getSelectedItem().toString()+"：00"+",606:"+bsEdt11.getText().toString());
//            } else {
//                builder.append("626:" + bsBoneHour11.getSelectedItem().toString()+"：00"+",606:"+bsEdt11.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt12.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",627:" + bsBoneHour12.getSelectedItem().toString()+"：00"+",607:"+bsEdt12.getText().toString());
//            } else {
//                builder.append("627:" + bsBoneHour12.getSelectedItem().toString()+"：00"+",607:"+bsEdt12.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt13.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",628:" + bsBoneHour13.getSelectedItem().toString()+"：00"+",608:"+bsEdt13.getText().toString());
//            } else {
//                builder.append("628:" + bsBoneHour13.getSelectedItem().toString()+"：00"+",608:"+bsEdt13.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt14.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",629:" + bsBoneHour14.getSelectedItem().toString()+"：00"+",609:"+bsEdt14.getText().toString());
//            } else {
//                builder.append("629:" + bsBoneHour14.getSelectedItem().toString()+"：00"+",609:"+bsEdt14.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt15.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",630:" + bsBoneHour15.getSelectedItem().toString()+"：00"+",610:"+bsEdt15.getText().toString());
//            } else {
//                builder.append("630:" + bsBoneHour15.getSelectedItem().toString()+"：00"+",610:"+bsEdt15.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt16.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",631:" + bsBoneHour16.getSelectedItem().toString()+"：00"+",611:"+bsEdt16.getText().toString());
//            } else {
//                builder.append("631:" + bsBoneHour16.getSelectedItem().toString()+"：00"+",611:"+bsEdt16.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt17.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",632:" + bsBoneHour17.getSelectedItem().toString()+"：00"+",612:"+bsEdt17.getText().toString());
//            } else {
//                builder.append("632:" + bsBoneHour17.getSelectedItem().toString()+"：00"+",612:"+bsEdt17.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt18.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",633:" + bsBoneHour18.getSelectedItem().toString()+"：00"+",613:"+bsEdt18.getText().toString());
//            } else {
//                builder.append("633:" + bsBoneHour18.getSelectedItem().toString()+"：00"+",613:"+bsEdt18.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt19.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",634:" + bsBoneHour19.getSelectedItem().toString()+"：00"+",614:"+bsEdt19.getText().toString());
//            } else {
//                builder.append("634:" + bsBoneHour19.getSelectedItem().toString()+"：00"+",614:"+bsEdt19.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt20.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",635:" + bsBoneHour20.getSelectedItem().toString()+"：00"+",615:"+bsEdt20.getText().toString());
//            } else {
//                builder.append("635:" + bsBoneHour20.getSelectedItem().toString()+"：00"+",615:"+bsEdt20.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt21.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",636:" + bsBoneHour21.getSelectedItem().toString()+"：00"+",616:"+bsEdt21.getText().toString());
//            } else {
//                builder.append("636:" + bsBoneHour21.getSelectedItem().toString()+"：00"+",616:"+bsEdt21.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt22.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",637:" + bsBoneHour22.getSelectedItem().toString()+"：00"+",617:"+bsEdt22.getText().toString());
//            } else {
//                builder.append("637:" + bsBoneHour22.getSelectedItem().toString()+"：00"+",617:"+bsEdt22.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt23.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",638:" + bsBoneHour23.getSelectedItem().toString()+"：00"+",618:"+bsEdt23.getText().toString());
//            } else {
//                builder.append("638:" + bsBoneHour23.getSelectedItem().toString()+"：00"+",618:"+bsEdt23.getText().toString());
//            }
//        }
//
//        if (!StringUtils.isEmpty(bsEdt24.getText().toString())) {
//            if (builder.length() != 0) {
//                builder.append(",639:" + bsBoneHour24.getSelectedItem().toString()+"：00"+",619:"+bsEdt24.getText().toString());
//            } else {
//                builder.append("639:" + bsBoneHour24.getSelectedItem().toString()+"：00"+",619:"+bsEdt24.getText().toString());
//            }
//        }


        Map<String, String> params = new HashMap<>();
        params.put("inpNo", inpNo);
        params.put("timestamp", System.currentTimeMillis() + "");
        params.put("timepoint", StringUtils.getDataTime("yyyy-MM-dd HH:mm:ss"));
        params.put("templateId", "79");
        params.put("signData", builder.toString());
        params.put("recorder", recorder);

        presenter.uploadRecord(params);
    }
}
